﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            //1、生成一个随机整型数组，长度是10，内容是1~10，数组内容不重复。
            
            Random random = new Random();
            ////2、生成0 - 5之间的随机小数，保留两位小数。
            //Console.WriteLine(Math.Round(random.NextDouble() * (5 - 0) + 0,2));
            ////3、生成4 - 7之间的随机小数，保留两位小数。
            //Console.WriteLine(Math.Round(random.NextDouble() * (7 - 4) + 4,2));

            int[] arr = new int[10];
            for (int i = 0; i < 10; i++)
            {
                arr[i] = random.Next(1,11);
                for (int i2 = 0; i2 < i; i2++)
                {
                    if (arr[i2]==arr[i])
                    {
                        arr[i] = random.Next(10);
                        i2 = -1;
                    }
                }
                Console.WriteLine(arr[i]);
            }

            DateTime now = DateTime.Now;
            Console.WriteLine(now.ToString());
            Console.WriteLine(now.Year);
            Console.WriteLine(now.Month);
            Console.WriteLine(now.DayOfWeek);
            Console.WriteLine((int)now.DayOfWeek);

            string datetime = "2021-05-28";

        }
    }
}
